Traffic control method and device

ABSTRACT

A traffic control method and device are provided. The method may include: monitoring a user behavior status of an application, where the user behavior status includes an active state or an inactive state; according to predefined correspondence between a user behavior status and a traffic control threshold, determining a traffic control threshold corresponding to the monitored user behavior status; and controlling traffic of the application by using the determined traffic control threshold. Therefore, the traffic of the application can be dynamically monitored and the intelligence of traffic control can be improved.

RELATED APPLICATIONS

This application is a continuation application of PCT Patent ApplicationNo. PCT/CN2013/076267, entitled “TRAFFIC CONTROL METHOD AND DEVICE”filed on May 27, 2013, which claims priority to Chinese PatentApplication No. 201210406224.3, entitled “TRAFFIC CONTROL METHOD ANDDEVICE” and filed on Oct. 23, 2012, both of which are incorporated byreference in their entirety.

TECHNICAL FIELD

The disclosed implementations relate generally to the field of networktechnologies, particularly to the field of network applicationtechnologies, and especially to a network traffic control method anddevice.

BACKGROUND

As network technologies develop, the rapid development of new networkapplications quickly follows suit. Some of such network applications areclient applications, in which the applications communicate with serversor other clients in a network, thereby generating network traffic. Forexample, as cellular networks become more advanced, ever more advancedsmart phone applications are developed that stream data to and from aclient device such as a smart-phone. These applications allow a user ofthe device to watch video clips, post pictures to social media sites,play games with friends, etc., all of which generate network traffic.When network traffic generated by such applications increases abruptly,a network overload may occur, thereby lowering performance ofapplications and affecting their normal use. Therefore, performingtraffic control on client applications is important to guaranteeing thenormal use of the applications. In some conventional methods of trafficcontrol, a traffic control threshold is employed to prevent a networkoverload (e.g., on the client side, in the form of an outbound trafficthreshold, or on the server side, in the form of a request trafficthreshold). In such methods, a maximum value of traffic (e.g., thetraffic control threshold) is set for a respective client correspondingto a specific period of time (for example, the client is allowed togenerate 2 megabytes per hour of traffic). When the total trafficgenerated by the applications of the client are less than or equal tothe traffic control threshold, each application can be used in a normalmode of operation. On the other hand, when the total traffic generatedby the applications of the client is greater than the traffic controlthreshold, network abnormality processing is performed, which caninclude, for example, restarting a networking program of an applicationor reporting abnormality information to a network server for handling.

However, in such methods, the control is performed with respect to totaltraffic of the client without taking into account usage differencesbetween the various applications of the client and behavioralcharacteristics of the user. Conventional methods of traffic control arethus inconvenient and burdensome for users because they are blind to thebehavioral characteristics of the user, which in some circumstances willindicate that a user would likely prefer that a particular applicationbe treated differently with respect to traffic control than anotherapplication. For example, in some circumstances it may be preferable tocontrol traffic more severely for applications running in thebackground, whose real-time services are less critical than anapplication running in the foreground. Likewise, in some circumstancesit may be preferable to control traffic less severely for applicationsrunning in the foreground.

SUMMARY

The embodiments described within the present disclosure address theaforementioned problems with conventional methods of traffic control byproviding a traffic control method and device, which can dynamicallymonitor traffic of an application and improve the intelligence oftraffic control.

Various implementations of systems, methods and devices within the scopeof the appended claims each have several aspects, no single one of whichis solely responsible for the attributes described herein. Withoutlimiting the scope of the appended claims, some prominent features aredescribed. After considering this disclosure, and particularly afterconsidering the section entitled “Detailed Description” one willunderstand how the features of various implementations enablecontrolling traffic of clients applications by using a traffic controlthreshold determined in accordance with a monitored user behaviorstatus.

According to some embodiments, a traffic control method, performed at aclient device, is provided that includes monitoring a user behaviorstatus of an application, where monitoring the user behavior statusincludes determining that the user behavior status is one of an activestate and an inactive state. The method further includes setting atraffic control threshold in accordance with the determined userbehavior status of the application, and controlling traffic of theapplication by using the traffic control threshold.

In some embodiments, determining the user behavior status of theapplication includes monitoring a current operating status of theapplication. When the application is currently in a foreground operatingstate, the user behavior status of the application is determined to bethe active state. When the application is currently in a backgroundoperating state, the user behavior status of the application isdetermined to be the inactive state.

In some embodiments, determining that the application is in thebackground operating state includes determining that the application hasremained in a background of the device for at least a predefined amountof time.

In some embodiments, monitoring the user behavior status of theapplication includes determining a current operating mode of theapplication. In accordance with a determination that the application iscurrently in a traffic control operating mode, monitoring the userbehavior status further includes determining that the user behaviorstatus of the application is the inactive state. In accordance with adetermination that the application is currently not in a traffic controloperating mode, monitoring the user behavior status determining that theuser behavior status of the application is the active state.

In some embodiments, when the user behavior status of the user is theactive state, the traffic control threshold is set to a first trafficcontrol threshold, and when the user behavior status of the user is theinactive state, the traffic control threshold is set to a second trafficthreshold that is less than the first traffic threshold.

In some embodiments, controlling the traffic of the application by usingthe determined traffic control threshold includes, when the trafficcontrol threshold is set to the first traffic control threshold,controlling the traffic of the application to be less than or equal tothe first traffic control threshold, and when the traffic controlthreshold is set to the second traffic threshold, controlling thetraffic of the application to be less than or equal to the secondtraffic control threshold.

In some embodiments, the method further includes, when the traffic ofthe application is greater than a predefined value, performing networkabnormality processing on the application.

Through implementation of the embodiments of the present invention, thefollowing beneficial effects exist:

In the embodiments, the traffic control threshold is determinedaccording to the user behavior status of the application, and thetraffic of the application is controlled using the determined trafficcontrol threshold, which can dynamically and intelligently monitor thetraffic of the application, taking full account of the usage of theapplication and a behavior characteristic of the user in theapplication, thereby improving the intelligence of the traffic control,and effectively guaranteeing normal use of the application.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a flow chart of a traffic control method, in accordance withsome embodiments.

FIG. 2 is a flow chart of a traffic control method, in accordance withsome embodiments.

FIG. 3 is a flow chart of a traffic control method, in accordance withsome embodiments.

FIG. 4 is a flow chart of a traffic control method, in accordance withsome embodiments.

FIG. 5 is a schematic structural diagram of a traffic control device, inaccordance with some embodiments.

FIG. 6 is a schematic structural diagram of an embodiment of amonitoring module shown in FIG. 5, in accordance with some embodiments.

FIG. 7 is a schematic structural diagram of an embodiment of amonitoring module shown in FIG. 5, in accordance with some embodiments.

FIG. 8 is a schematic structural diagram of an embodiment of amonitoring module shown in FIG. 5, in accordance with some embodiments.

FIG. 9 is a schematic structural diagram of a traffic control device, inaccordance with some embodiments.

FIG. 10 is a diagram of a client-server environment, in accordance withsome implementations.

FIG. 11 is a diagram of an example implementation of a client device inaccordance with some implementations.

Like reference numerals refer to corresponding parts throughout theseveral views of the drawings.

DETAILED DESCRIPTION

In the embodiments of the present disclosure, an application (or “clientapplication”) refers to software capable of being installed at a client,and performing data processing through networking. Various types of suchapplications include, but are not limited to, instant messagingapplication, social networking services (SNS) application, and gameapplications. In some embodiments, the clients include apparatuses suchas personal computers (PC), tablet computers, mobile phones, smartphones, electronic readers, notebook computer, and vehicle terminals.

In some embodiments, a user behavior status of a user is associated witha particular application. In some embodiments, the user behavior statusof the user is one of an active state and an inactive state. The activestate indicates that when the user uses the application, a large numberof network requests are generated by the application, and consumedtraffic is high. On the other hand, the inactive state indicates thatwhen the user uses the application, a smaller number of network requestsare generated by the application, and consumed traffic is low. Variousways of defining the active state and the inactive state of a givenapplication are possible, and will be apparent to one of ordinary skillin the art. In some embodiments, the active state (or the inactivestate) is predefined. For example, a request threshold may be definedfor a period of time such that, when the request threshold is exceededduring the period of time, the user behavior status is determined to bethe active state; otherwise, the user behavior status is the inactivestate. In some implementations, the active state is defined such thatwhen the user uses the application at the foreground of the client, thatis, when the application is in a foreground operating state, itrepresents the active state. Conversely, when the user uses theapplication at the background of the client, that is, the application isin a background operating state, it represents the inactive state. Insome implementations, when the user uses the application at theforeground of the client, that is, the application is in the foregroundoperating state, it represents the active state, and when the user usesthe application at the background for a long time, (e.g., theapplication remains in the background operating state in excess ofpredefined value such as 10 minutes, or 20 minutes), it represents theinactive state. In some implementations, a traffic control option may beprovided in an interface of the application, and when the user opts toperform traffic control on the application, the application enters atraffic control operating mode, which represents the inactive state.Conversely, when the user does not opts to perform traffic control(e.g., forgoes performing) on the application, it represents the activestate.

A traffic control threshold refers to a maximum value of traffic that isallowed to be consumed by the application within a specified unit oftime. In some embodiments, a plurality of traffic control thresholds isemployed and a respective traffic control threshold of the plurality oftraffic control thresholds is set in accordance with the user behaviorstatus of the application. For example, in some embodiments, two trafficcontrol thresholds correspond, respectively, to the active state and theinactive state. For example, the two traffic control thresholds includea first traffic control threshold and a second traffic control thresholdthat is less than the first traffic control threshold. In this example,there is a predefined correspondence between a user behavior status anda traffic control threshold is such that the active state corresponds tothe first traffic control threshold and the inactive state correspondsto the second traffic control threshold.

Exemplary traffic control methods are provided by the embodiments of thepresent invention are described in detail in the following withreference to FIG. 1 to FIG. 4.

Referring to FIG. 1, FIG. 1 is a flow chart of a traffic control method100 according to some embodiments. The method includes the operationS101 through operation S103.

S101: Monitor a user behavior status of an application, where monitoringthe user behavior status includes determining that the user behaviorstatus is one of an active state and an inactive state.

In this operation, the user behavior status of the application isdetermined by monitoring an operating status or an operating mode of theapplication. For example, when the application is detected in aforeground operating state, the user behavior status is set to theactive state. When the application is detected a background operatingstate, user behavior status is set to the inactive state. In someembodiments, the user behavior status of the application is alsodetermined by monitoring the operating mode of the application. Forexample, when an application includes a traffic control option, theclient device detects whether the user has selected the traffic controloption (e.g., whether the application is in a traffic control operatingmode). When it is detected that the application is currently in thetraffic control operating mode, the user behavior status is set to theactive state; otherwise, the user behavior status is set to the inactivestate.

S102: Set a traffic control threshold in accordance with the determineduser behavior status of the application.

As mentioned above, in some embodiments, there is a predefinedcorrespondence between the user behavior status and the traffic controlthreshold. For example, the active state corresponds to the firsttraffic control threshold and the inactive state corresponds to thesecond traffic control threshold. Because many network requests aregenerated by the application and consumed traffic is high in the activestate, as compared to the inactive state, the first traffic controlthreshold is set to a greater value than the second traffic controlthreshold. For example, in some embodiments, the first traffic controlthreshold is 8 megabytes (Mb)/hour and the second traffic controlthreshold is 2 Mb/hour.

S103: Control traffic of the application by using the traffic controlthreshold.

The specific control process of this operation is that: when the userbehavior status of the application is the active state, the traffic ofthe application is controlled to be less than or equal to the firsttraffic control threshold. When the user behavior status of theapplication is the inactive state, the traffic of the application iscontrolled to be less than or equal to the second traffic controlthreshold.

Referring to FIG. 2, FIG. 2 is a flow chart of a traffic control method200, in accordance with some embodiments. The method includes thefollowing operation S201 through operation S208.

S201: Monitor a current operating status of an application.

S202: When the application is currently in a foreground operating state,determine that a user behavior status of the application is an activestate.

S203: According to a predefined correspondence between the user behaviorstatus and a traffic control threshold, set the traffic controlthreshold to be a first traffic control threshold.

S204: Control traffic of the application to be less than or equal to thefirst traffic control threshold, and then turn to operation S208.

S205: When the application is currently in a background operating state,determine that the user behavior status of the application is aninactive state.

S206: According to the predefined correspondence between the userbehavior status and the traffic control threshold, set the trafficcontrol threshold to be a second traffic control threshold.

S207: Control traffic of the application to be less than or equal to thesecond traffic control threshold, and then turn to operation S208.

S208: When the traffic of the application is greater than a predefinedvalue, perform network abnormality processing on the application.

In some embodiments, the predefined value is set according to a networkstatus. For example, the predefined value is set in accordance with oneof the following, or a combination thereof: a bandwidth supported by anetwork, a processing capacity of a network server, a data transmissioncapacity of the network. The predefined value indicates a maximum valueof traffic of the application that is acceptable by the network and isallowed to be consumed in a specified amount of time. In someembodiments, the predefined value is equal to the first traffic controlthreshold. When current traffic of the application is less than or equalto the predefined value, (e.g., traffic consumed by network requestsfrom the application is less than or equal to the predefined value), thecurrent traffic is in a normal processing range of the network, and thenetwork will run normally. When the traffic of the application isgreater than the predefined value, the current traffic exceeds a normalprocessing range of the network, the network is overloaded, and thenetwork is abnormal. At this time, the network abnormality processingneeds to be performed on the application. In some embodiments, thenetwork abnormality processing includes, but is not limited to,restarting a networking program of the application, reportingabnormality information to a network server, and so on.

The following is an example of the traffic control method 200 with thefollowing exemplary details: the application is an instant messagingapplication, the predefined value is 8 Mb/hour, the first trafficcontrol threshold is 8 Mb/hour, and the second traffic control thresholdis 2 Mb/hour. When a user does not use the instant messagingapplication, traffic of the instant messaging application is very small(e.g., close or equal to zero). As the user uses the instant messagingapplication, the number of network requests generated by the instantmessaging application is increased and the consumed traffic is alsoincreased. Under these exemplary circumstances, the traffic controlmethod 200 proceeds as follows, in accordance with some embodiments:

An operating status of the instant messaging application is monitored.When it is detected that the instant messaging application is currentlyin a foreground operating state, it is determined that a user behaviorstatus of the user in the instant messaging application is the activestate, and it is determined that the first traffic control threshold of8 Mb/hour is to be used to control the traffic of the instant messagingapplication, that is, the traffic consumed by the instant messagingapplication is controlled to be less than or equal to 8 Mb/hour.

When it is detected that the instant messaging application is currentlyin a background operating state, it is determined that the user behaviorstatus of the user in the instant messaging application is an inactivestate, and it is determined that the second traffic control threshold of2 Mb/hour is to be used to control the traffic of the instant messagingapplication, that is, the traffic consumed by the instant messagingapplication is controlled to be less than or equal to 2 Mb/hour.

When the traffic of the instant messaging application consumed in onehour reaches 8 Mb (e.g., within the previous hour, or within a fixed onehour period), and the number of network requests of the instantmessaging application is still increased in the one hour, (e.g., theconsumed traffic is still increased, so that the traffic of the instantmessaging application is greater than 8 Mb/hour) network abnormalityprocessing is performed on the instant messaging application.

Referring to FIG. 3, FIG. 3 is a flow chart of a traffic control method300 according to some embodiments. Method 300 includes the followingoperations S301 through operation S309.

S301: Monitor a current operating status of an application.

S302: When the application is currently in a foreground operating state,determine that a user behavior status of the application is an activestate.

S303: According to predefined correspondence between the user behaviorstatus and a traffic control threshold, set the traffic controlthreshold to be a first traffic control threshold.

S304: Control traffic of the application to be less than or equal to thefirst traffic control threshold, and then turn to operation S309.

S305: When the application is currently in a background operating state,determine whether the application has remained in a background of thedevice for at least a predefined amount of time. When yes, turn tooperation S306; otherwise, end the procedure.

In this operation, the time threshold may be set as required. Forexample, the time threshold may be set as 20 minutes according to a usehabit of the user. When the duration that the application has remainedin the background operating state exceeds 20 minutes (e.g., theapplication is switched from the foreground operating state to thebackground operating state and remains in the background state for inexcess of 20 minutes), it is determined that the user behavior status ofthe application is the inactive state. Alternatively, during theinterval when the application has remained in the background operatingstate for less than 20 minutes (e.g., the application is switched fromthe foreground operating state to the background operating state and theduration that the background operating state is less than 20 minutes),it is determined that the user behavior status of the application is theactive state. The time threshold is set so as to avoid resource lossowing to frequent switching between the active state and the inactivestate in circumstances where the user performs frequentforeground-background switching on the application, thereby ensuringsystem performance and network stability. Thus, operation S305 providesa hysteresis in switching between the active and inactive statuses.

S306: Determine that the user behavior status of the application is aninactive state.

S307: According to predefined correspondence between the user behaviorstatus and the traffic control threshold, set the traffic controlthreshold to be a second traffic control threshold.

S308: Control traffic of the application to be less than or equal to thesecond traffic control threshold, and then turn to operation S309.

S309: When the traffic of the application is greater than a predefinedvalue, perform network abnormality processing on the application.

In some embodiments, for operation S309, reference may be made tooperation S208 in the embodiment shown in FIG. 2, the details of whichare not repeated here.

The following is an example of the traffic control method 300 with thefollowing exemplary details: the application is an instant messagingapplication, the predefined value is 8 Mb/hour, the first trafficcontrol threshold is 8 Mb/hour, the second traffic control threshold is2 Mb/hour, and the predefined time threshold is 20 minutes. When a userdoes not use the instant messaging application, traffic of the instantmessaging application is 0 Mb/hour. As the user uses the instantmessaging application, the number of network requests generated by theinstant messaging application is increased and consumed traffic isincreased. Under these exemplary circumstances, the traffic controlmethod 300 proceeds as follows, in accordance with some embodiments:

An operating status of the instant messaging application is monitored.When it is detected that the instant messaging application is currentlyin a foreground operating state, it is determined that the user behaviorstatus of the user in the instant messaging application is the activestate, and it is determined that the first traffic control threshold 8Mb/hour is used to control the traffic of the instant messagingapplication (e.g., the traffic consumed by the instant messagingapplication is controlled to be less than or equal to 8 Mb/hour).

When it is detected that the instant messaging application is currentlyin the background operating state, a determination is made as to whetherthe instant messaging application has remained in background operatingstate for in excess of 20 minutes. When the instant messagingapplication has not remained in background operating state for in excessof 20 minutes, no processing is performed. When the instant messagingapplication has remained in background operating state for in excess of20 minutes, it is determined that the user behavior status of the userin the instant messaging application is the inactive state, and it isdetermined that the second traffic control threshold of 2 Mb/hour is tobe used to control the traffic of the instant messaging application(e.g., the traffic consumed by the instant messaging application iscontrolled to be less than or equal to 2 Mb/hour).

When the traffic of the instant messaging application consumed in onehour reaches 8 Mb, and the number of network requests of the instantmessaging application is still increased in the one hour, (e.g., theconsumed traffic is still increased, so that the traffic of the instantmessaging application is greater than 8 Mb/hour), network abnormalityprocessing is performed on the instant messaging application.

Referring to FIG. 4, FIG. 4 is a flow chart of a traffic control method400 according to some embodiments. Method 400 includes the followingoperations S401 through operation S409.

S401: Monitor a current operating mode of an application.

In some embodiments, a traffic control option is provided in aninterface of the application, and when the user opts to perform trafficcontrol on the application, the application enters a traffic controloperating mode. This operation can detect whether the user selects thetraffic control option. When it is detected that the user selects thetraffic control option, it is determined that the application is intraffic control operating mode. Otherwise, it is determined that theapplication is in a non-traffic control operating mode.

S402: Determine whether the application is currently in a trafficcontrol operating mode. When the application is not currently in thetraffic control operating mode, turn to operation S403. Otherwise, turnto operation S406.

S403: Determine that a user behavior status of the application is anactive state.

S404: According to predefined correspondence between the user behaviorstatus and a traffic control threshold, set the traffic controlthreshold to be a first traffic control threshold.

S405: Control traffic of the application to be less than or equal to thefirst traffic control threshold, and then turn to operation S409.

S406: Determine that the user behavior status of the application is aninactive state.

S407: According to predefined correspondence between the user behaviorstatus and the traffic control threshold, set the traffic controlthreshold to be a second traffic control threshold.

S408: Control traffic of the application to be less than or equal to thesecond traffic control threshold, and then turn to operation S409.

S409: When the traffic of the application is greater than a predefinedvalue, perform network abnormality processing on the application.

In some embodiments, for operation S409, reference may be made tooperation S208 in the embodiment shown in FIG. 2, the details of whichare not repeated here.

The following is an example of the traffic control method 400 with thefollowing exemplary details: the application is an instant messagingapplication, a predefined value is 8 Mb/hour, a first traffic controlthreshold is 8 Mb/hour, and a second traffic control threshold is 2Mb/hour. When a user does not use the instant messaging application,traffic of the instant messaging application is 0 Mb/hour. As the useruses the instant messaging application, the number of network requestsgenerated by the instant messaging application is increased and consumedtraffic is increased. Under these exemplary circumstances, the trafficcontrol method 400 proceeds as follows, in accordance with someembodiments:

An operating mode of the instant messaging application is monitored.When it is detected that the instant messaging application is currentlyin the non-traffic control operating mode, it is determined that theuser behavior status of the user in the instant messaging application isthe active state, and it is determined that the first traffic controlthreshold 8 Mb/hour is to be used to control the traffic of the instantmessaging application, (e.g., the traffic consumed by the instantmessaging application is controlled to be less than or equal to 8Mb/hour).

When it is detected that the instant messaging application is currentlyin the traffic control operating mode, it is determined that the userbehavior status of the user in the instant messaging application is theinactive state, and it is consequently determined that the secondtraffic control threshold 2 Mb/hour is to be used to control the trafficof the instant messaging application, (e.g., the traffic consumed by theinstant messaging application is controlled to be less than or equal to2 Mb/hour).

When the traffic of the instant messaging application consumed in onehour reaches 8 Mb, and the number of network requests of the instantmessaging application is still increased in the one hour, (e.g., theconsumed traffic is still increased, so that the traffic of the instantmessaging application is greater than 8 Mb/hour), network abnormalityprocessing is performed on the instant messaging application.

In accordance with some embodiments of the foregoing methods (e.g.,methods 100, 200, 300, and 400), a traffic control threshold isdetermined according to a user behavior status of a user in aapplication, and the traffic of the application is controlled by usingthe determined traffic control threshold, which can dynamically andintelligently monitor the traffic of the application, take full accountof the usage of the application and a behavior characteristic of theuser in the application, thus improving the intelligence of the trafficcontrol, and effectively guaranteeing normal use of the application.

In accordance with some embodiments, a traffic control device isprovided in the following description with reference to FIG. 5 to FIG.9. In some embodiments, the traffic control device is a client devicethat is independent of an application. In some embodiments, the trafficcontrol device is a module of the application. It should be noted that,the following device may be applied in the foregoing methods (e.g.,methods 100, 200, 300, and 400).

Referring to FIG. 5, FIG. 5 is a schematic structural diagram of atraffic control device 500 according to some embodiments. The device 500includes a monitoring module 101, a threshold determining module 102,and a control module 103.

The monitoring module 101 is configured to monitor a user behaviorstatus of an application, where the user behavior status includes anactive state or an inactive state.

In some embodiments, the monitoring module 101 includes one or more thefollowing three implementations, or combinations thereof, where thefirst implementation manner is described as follows:

With reference to FIG. 6, FIG. 6 is a schematic structural diagram ofthe monitoring module 101 shown in FIG. 5, in accordance with someembodiments. The monitoring module includes a first monitoring unit 1101and a first status determining unit 1102.

The first monitoring unit 1101 is configured to monitor a currentoperating status of the application.

The first status determining unit 1102 is configured to: when theapplication is currently in a foreground operating state, determine thatthe user behavior status of the application is the active state, and,when the application is currently in a background operating state,determine that the user behavior status of the application is theinactive state.

The second implementation manner is described as follows:

With reference to FIG. 7, FIG. 7 is a schematic structural diagram themonitoring module 101 shown in FIG. 5, in accordance with someembodiments. The monitoring module includes a first monitoring unit1101, a first status determining unit 1102, and a judgment unit 1103.For structures of the first monitoring unit 1101 and the first statusdetermining unit 1102, reference may be made to relevant descriptions ofthe embodiment shown in FIG. 6, which are not elaborated herein.

The judgment unit 1103 is configured to: when the first monitoring unitdetects that the application is currently in the background operatingstate, judge whether a duration that the application has remained inbackground operating state exceeds a predefined time threshold, and whena judgment result is yes, notify the first status determining unit ofthe determination that the user behavior status of the application isthe inactive state.

The third implementation manner is described as follows:

With reference to FIG. 8, FIG. 8 is a schematic structural diagram themonitoring module shown in FIG. 5. in accordance with some embodiments.The monitoring module includes a second monitoring unit 1111 and asecond status determining unit 1112.

The second monitoring unit 1111 is configured to monitor a currentoperating mode of the application.

The second status determining unit 1112 is configured to: when theapplication is currently in a traffic control operating mode, determinethat the user behavior status of the application is the inactive state;otherwise, determine that the user behavior status of the application isthe active state.

The threshold determining module 102 is configured to: according topredefined correspondence between the user behavior status and a trafficcontrol threshold, determine the traffic control threshold correspondingto the monitored user behavior status.

In some embodiments, the predefined correspondence between the userbehavior status and the traffic control threshold is that, the activestate corresponds to a first traffic control threshold and the inactivestate corresponds to a second traffic control threshold that is lessthan the first traffic control threshold. Because many network requestsare generated by the application and consumed traffic is high in theactive state, and fewer network requests are generated by theapplication and the consumed traffic is low in the inactive state, thefirst traffic control threshold is set to be greater than the secondtraffic control threshold. For example, in some circumstances, the firsttraffic control threshold is 8 Mb/hour and the second traffic controlthreshold is 2 Mb/hour.

The control module 103 is configured to control traffic of theapplication by using the determined traffic control threshold.

A specific control process of this operation is: when the user behaviorstatus of the application is the active state, controlling the trafficof the application to be less than or equal to the first traffic controlthreshold. Conversely, when the user behavior status of the applicationis the inactive state, controlling the traffic of the application to beless than or equal to the second traffic control threshold.

Referring to FIG. 9, FIG. 9 is a schematic structural diagram a trafficcontrol device according to some embodiment. The device includes amonitoring module 101, a threshold determining module 102, a controlmodule 103, and an abnormality processing module 104. The monitoringmodule 101, the threshold determining module 102, and the control module103, are analogous to those described with reference to FIG. 5 throughFIG. 8, the details of which are not elaborated here.

The abnormality processing module 104 is configured to: when the trafficof the application is greater than a predefined value, perform networkabnormality processing on the application.

In some embodiments, the predefined value is set in accordance with anetwork status. For example, the predefined value is set in accordancewith a bandwidth supported by a network, a processing capacity of anetwork server, a data transmission capacity of the network, or acombination thereof. The predefined value indicates a maximum value oftraffic of the application that can be accepted by the network and isallowed to be consumed in unit time. In some embodiments, the predefinedvalue is equal to a first traffic control threshold. When the traffic ofthe application is less than or equal to the predefined value, (e.g.,traffic consumed by network requests of the application is less than orequal to the predefined value), the current traffic is in a normalprocessing range of the network, and the network runs normally. When thetraffic of the application is greater than the predefined value, currenttraffic exceeds the normal processing range of the network, the networkis overloaded, and the network is abnormal. At this time, networkabnormality processing is performed on the application. A manner of thenetwork abnormality processing performed by the abnormality processingmodule 104 includes, but is not limited to, restarting a networkingprogram of the application, reporting abnormality information to anetwork server, and so on.

It should be noted that, a function of each function module of thetraffic control device in the embodiments of the present invention maybe specifically implemented according to the method in the foregoingmethod embodiments, and for a specific implementation process, referencemay be made to relevant descriptions in the foregoing methodembodiments, which are not elaborated herein.

FIG. 10 is a diagram of a client-server environment 1000 in accordancewith some implementations. While certain specific features areillustrated, those skilled in the art will appreciate from the presentdisclosure that various other features have not been illustrated for thesake of brevity and so as not to obscure more pertinent aspects of theimplementations disclosed herein. To that end, the client-serverenvironment 1000 includes a server system 1050, a mobile phone operator1022 (i.e., wireless carrier), an internet service provider 1020, and acommunications network 104. Each of the server system 1050, the mobilephone operator 1022 (i.e. wireless carrier), and the internet serviceprovider 1020 are capable of being connected to the communicationnetwork 1004 in order to exchange information with one another and/orother devices and systems. Within the server system 1050, there is aserver computer 1051 for receiving and processing the data received fromthe client devices 1002 and 1003. Additionally, the mobile phoneoperator 1022 and the internet service provider 1020 are operable toconnect client devices to the communication network 1004 as well. Forexample, a smart phone 1002 is operable with the network of the mobilephone operator 1022, which includes for example, a base station 1022 a.Similarly, for example, a laptop computer 1003 (or tablet, desktop,workstation or the like) is connectable to the network provided by theinternet service provider 1020, which is ultimately connectable to thecommunication network 104. Moreover, while FIG. 10 only includes one ofeach of the aforementioned devices and systems, those skilled in the artwill appreciate from the present disclosure that any number of suchdevices and/or systems may be provided in a client-server environment,and particular devices may be altogether absent. In other words, theclient-server environment 1000 is merely an example provided to discussmore pertinent features of the present disclosure.

The communication network 1004 may be any combination of wired andwireless local area network (LAN) and/or wide area network (WAN), suchas an intranet, an extranet, including a portion of the Internet. It issufficient that the communication network 1004 provides communicationcapability between client devices and servers. In some implementations,the communication network 1004 uses the HyperText Transport Protocol(HTTP) to transport information using the Transmission ControlProtocol/Internet Protocol (TCP/IP). HTTP permits a client device toaccess various resources available via the communication network 1004.However, the various implementations described herein are not limited tothe use of any particular protocol.

As discussed below in greater detail with reference to FIG. 11, someclient devices, such as the laptop 1003 and smart phone 1002, include adisplay and a digital camera. In some implementations, a mobileapplication is operated at least in part by the client device. Inoperation, the mobile application (e.g., a client application) mayinteract with the network and one or more hardware elements (e.g., thedigital camera) to produce network traffic. For example, a user a smartphone 1002 may take a picture with a digital camera of the smart phoneand post it to a social networking service via communication network1004.

FIG. 11 is a diagram of an example implementation of a client device1002/1003 (e.g., laptop 1003 and smart phone 1002), discussed above withreference to FIG. 10, in accordance with some implementations. Whilecertain specific features are illustrated, those skilled in the art willappreciate from the present disclosure that various other features havenot been illustrated for the sake of brevity and so as not to obscuremore pertinent aspects of the implementations disclosed herein. To thatend, the client device 1002/1003 includes one or more processing units(CPU's) 1102, one or more network or other communications interfaces1108, a display 1101, memory 1106, a digital camera 1109, and one ormore communication buses for interconnecting these and various othercomponents. The communication buses may include circuitry (sometimescalled a chipset) that interconnects and controls communications betweensystem components. The memory 1106 includes high-speed random accessmemory, such as DRAM, SRAM, DDR RAM or other random access solid statememory devices; and may include non-volatile memory, such as one or moremagnetic disk storage devices, optical disk storage devices, flashmemory devices, or other non-volatile solid state storage devices. Thememory 1106 may optionally include one or more storage devices remotelylocated from the CPU(s) 1102. The memory 1106, including thenon-volatile and volatile memory device(s) within the memory 1106,comprises a non-transitory computer readable storage medium.

In some implementations, the memory 1106 or the non-transitory computerreadable storage medium of the memory 1106 stores the followingprograms, modules and data structures, or a subset thereof including anoperating system 1116, a network communication module 1118, and atraffic control module 1131.

The operating system 1116 includes procedures for handling various basicsystem services and for performing hardware dependent tasks.

The network communication module 1118 facilitates communication withother devices via the one or more communication network interfaces 1108(wired or wireless) and one or more communication networks, such as theinternet, other wide area networks, local area networks, metropolitanarea networks, and so on.

The traffic control module 1131 is configured to control network traffic(e.g., over network 1004) originating from one or more clientapplications on client device 1002/1003 based at least in part on a userbehavior status of a user using client device 1002. To that end, thetraffic control 1131 includes an monitoring module 1110 for monitoring auser behavior status of the user, a setting module 1111 for setting atraffic control threshold in accordance with the user behavior status ofthe user, and a control module 1112 for controlling traffic over thenetwork from the application in accordance with the set traffic controlthreshold. To that end, the monitoring module 1110 includes a set ofinstructions 1110 a and heuristics and metadata 1110 b (metadata couldinclude, for example, a register indicating whether the user has optedto perform traffic control management). Similarly, the setting module1111 includes a set of instructions 1111 a as well as metadata andheuristics 1111 b, and control module 1112 includes a set ofinstructions 1112 a and metadata and heuristics 1112 b.

Through the descriptions of the foregoing device embodiments, in theembodiments of the present invention, the traffic control threshold isdetermined according to the user behavior status of the application, andthe traffic of the application is controlled by using the determinedtraffic control threshold, which can dynamically and intelligentlymonitor the traffic of the application, take full account of the usageof the application and a behavior characteristic of the user in theapplication, improve the intelligence of the traffic control, andeffectively guarantee normal use of the application.

Persons of ordinary skill in the art may understand that all or a partof the processes of the foregoing method embodiments may be completed bya computer program instructing relevant hardware. The program may bestored in a computer readable storage medium. When the program is run,the processes of the foregoing method embodiments are performed. Thestorage medium may be a magnetic disk, an optical disk, a Read-OnlyMemory (ROM), a Random Access Memory (RAM), and the like.

The foregoing disclosures are only exemplary embodiments of the presentinvention, and are definitely not intended to limit the protection scopeof the present invention; therefore, any equivalent change madeaccording to the claims of the present invention still falls within thescope of the present invention.

While particular embodiments are described above, it will be understoodit is not intended to limit the invention to these particularembodiments. On the contrary, the invention includes alternatives,modifications and equivalents that are within the spirit and scope ofthe appended claims. Numerous specific details are set forth in order toprovide a thorough understanding of the subject matter presented herein.But it will be apparent to one of ordinary skill in the art that thesubject matter may be practiced without these specific details. In otherinstances, well-known methods, procedures, components, and circuits havenot been described in detail so as not to unnecessarily obscure aspectsof the embodiments.

Although the terms first, second, etc. may be used herein to describevarious elements, these elements should not be limited by these terms.These terms are only used to distinguish one element from another. Forexample, first ranking criteria could be termed second ranking criteria,and, similarly, second ranking criteria could be termed first rankingcriteria, without departing from the scope of the present invention.First ranking criteria and second ranking criteria are both rankingcriteria, but they are not the same ranking criteria.

The terminology used in the description of the invention herein is forthe purpose of describing particular embodiments only and is notintended to be limiting of the invention. As used in the description ofthe invention and the appended claims, the singular forms “a,” “an,” and“the” are intended to include the plural forms as well, unless thecontext clearly indicates otherwise. It will also be understood that theterm “and/or” as used herein refers to and encompasses any and allpossible combinations of one or more of the associated listed items. Itwill be further understood that the terms “includes,” “including,”“comprises,” and/or “comprising,” when used in this specification,specify the presence of stated features, operations, elements, and/orcomponents, but do not preclude the presence or addition of one or moreother features, operations, elements, components, and/or groups thereof.

As used herein, the term “when” may be construed to mean “when” or“upon” or “in response to determining” or “in accordance with adetermination” or “in response to detecting,” that a stated conditionprecedent is true, depending on the context. Similarly, the phrase “whenit is determined [that a stated condition precedent is true]” or “when[a stated condition precedent is true]” or “when [a stated conditionprecedent is true]” may be construed to mean “upon determining” or “inresponse to determining” or “in accordance with a determination” or“upon detecting” or “in response to detecting” that the stated conditionprecedent is true, depending on the context.

Although some of the various drawings illustrate a number of logicalstages in a particular order, stages that are not order dependent may bereordered and other stages may be combined or broken out. While somereordering or other groupings are specifically mentioned, others will beobvious to those of ordinary skill in the art and so do not present anexhaustive list of alternatives. Moreover, it should be recognized thatthe stages could be implemented in hardware, firmware, software or anycombination thereof.

The foregoing description, for purpose of explanation, has beendescribed with reference to specific implementations. However, theillustrative discussions above are not intended to be exhaustive or tolimit the invention to the precise forms disclosed. Many modificationsand variations are possible in view of the above teachings. Theimplementations were chosen and described in order to best explainprinciples of the invention and its practical applications, to therebyenable others skilled in the art to best utilize the invention andvarious implementations with various modifications as are suited to theparticular use contemplated. Implementations include alternatives,modifications and equivalents that are within the spirit and scope ofthe appended claims. Numerous specific details are set forth in order toprovide a thorough understanding of the subject matter presented herein.But it will be apparent to one of ordinary skill in the art that thesubject matter may be practiced without these specific details. In otherinstances, well-known methods, procedures, components, and circuits havenot been described in detail so as not to unnecessarily obscure aspectsof the implementations.

What is claimed is:
 1. A method of controlling network traffic from anapplication running on a client device, the method comprising: at aclient device: determining whether the application is in a user-selectedtraffic control operating mode; when the application is in theuser-selected traffic control operating mode, performing traffic controlon the application, the traffic control including: monitoring a userbehavior status of the application, wherein monitoring the user behaviorstatus includes determining that the user behavior status is one of anactive state and an inactive state, and wherein determining the userbehavior status of the application comprises: monitoring a currentoperating status of the application; when the application is currentlyin a foreground operating state, determining that the user behaviorstatus of the application is the active state; and when the applicationis currently in a background operating state, determining that the userbehavior status of the application is the inactive state; setting atraffic control threshold in accordance with the determined userbehavior status of the application; and controlling traffic of theapplication by using the traffic control threshold; wherein: when theuser behavior status of the user is the active state, the trafficcontrol threshold is set to a first traffic control threshold; and whenthe user behavior status of the user is the inactive state, the trafficcontrol threshold is set to a second traffic threshold that is less thanthe first traffic threshold when the application is not in theuser-selected traffic control operating mode, forgoing performing thetraffic control on the application.
 2. The method according to claim 1,wherein determining that the application is in the background operatingstate includes determining that the application has remained in abackground of the client device for at least a predefined amount oftime.
 3. The method according to claim 1, wherein controlling thetraffic of the application by using the determined traffic controlthreshold comprises: when the traffic control threshold is set to thefirst traffic control threshold, controlling the traffic of theapplication to be less than or equal to the first traffic controlthreshold; and when the traffic control threshold is set to the secondtraffic threshold, controlling the traffic of the application to be lessthan or equal to the second traffic control threshold.
 4. The methodaccording to claim 3, further comprising: when the traffic of theapplication is greater than a predefined value, performing networkabnormality processing on the application.
 5. A device configured tocontrol network traffic comprising: one or more processors; a networkinterface; and memory including instructions that, when executed by theone or more processors, cause the device to: determine whether anapplication is in a user-selected traffic control operating mode; whenthe application is in the user-selected traffic control operating mode,perform traffic control on the application, the traffic controlincluding: monitor a user behavior status of the application, whereinmonitoring the user behavior status includes determining that the userbehavior status is one of an active state and an inactive state, andwherein determining the user behavior status of the applicationcomprises: monitoring a current operating status of the application;when the application is currently in a foreground operating state,determining that the user behavior status of the application is theactive state; and when the application is currently in a backgroundoperating state, determining that the user behavior status of theapplication is the inactive state; set a traffic control threshold inaccordance with the determined user behavior status of the application;and control traffic of the application by using the traffic controlthreshold; wherein: when the user behavior status of the user is theactive state, the traffic control threshold is set to a first trafficcontrol threshold; and when the user behavior status of the user is theinactive state, the traffic control threshold is set to a second trafficthreshold that is less than the first traffic threshold when theapplication is not in the user-selected traffic control operating mode,forgo performing the traffic control on the application.
 6. The deviceaccording to claim 5, wherein the instruction for determining that theapplication is in the background operating state includes instructionsfor determining that the application has remained in a background of thedevice for at least a predefined amount of time.
 7. The device accordingto claim 5, wherein the instruction for controlling the traffic of theapplication by using the determined traffic control threshold furthercomprises instructions for: when the traffic control threshold is set tothe first traffic control threshold, controlling the traffic of theapplication to be less than or equal to the first traffic controlthreshold; or when the traffic control threshold is set to the secondtraffic threshold, controlling the traffic of the application to be lessthan or equal to the second traffic control threshold.
 8. The deviceaccording to claim 5, wherein the memory further includes instructionsthat, when executed by the one or more processors, cause the device toperform network abnormality processing on the application when thetraffic of the application is greater than a predefined value.
 9. Anon-transitory computer readable storage medium in conjunction with aclient device, the computer readable storage medium storing one or moreprograms for controlling network traffic from an application running onthe client device, the one or more programs including instructions for:determining whether the application is in a user-selected trafficcontrol operating mode; when the application is in the user-selectedtraffic control operating mode, performing traffic control on theapplication, the traffic control including: monitoring a user behaviorstatus of the application, wherein monitoring the user behavior statusincludes determining that the user behavior status is one of an activestate and an inactive state, and wherein determining the user behaviorstatus of the application comprises: monitoring a current operatingstatus of the application; when the application is currently in aforeground operating state, determining that the user behavior status ofthe application is the active state; and when the application iscurrently in a background operating state, determining that the userbehavior status of the application is the inactive state; setting atraffic control threshold in accordance with the determined userbehavior status of the application; and controlling traffic of theapplication by using the traffic control threshold; wherein: when theuser behavior status of the user is the active state, the trafficcontrol threshold is set to a first traffic control threshold; and whenthe user behavior status of the user is the inactive state, the trafficcontrol threshold is set to a second traffic threshold that is less thanthe first traffic threshold when the application is not in theuser-selected traffic control operating mode, forgoing performing thetraffic control on the application.
 10. The non-transitory computerreadable storage medium according to claim 9, wherein the instructionfor determining that the application is in the background operatingstate includes instructions for determining that the application hasremained in a background of the client device for at least a predefinedamount of time.
 11. The non-transitory computer readable storage mediumaccording to claim 9, wherein the instruction for controlling thetraffic of the application by using the determined traffic controlthreshold further include instructions for: when the traffic controlthreshold is set to the first traffic control threshold, controlling thetraffic of the application to be less than or equal to the first trafficcontrol threshold; and when the traffic control threshold is set to thesecond traffic threshold, controlling the traffic of the application tobe less than or equal to the second traffic control threshold.